package actualizador;

import java.net.UnknownHostException;

import utiles.IDatosEquipoRemoto;
import utiles.Ip;


public class DatoEquipo implements Comparable<DatoEquipo>, IDatosEquipoRemoto{
	/**
	 * 
	 */
	private static final long serialVersionUID = -6254007376515405450L;
	private static int ULTIMO_ID= 0;
	private String id;

	
	private String ip;
	
	public DatoEquipo() {
		this(null);
	}
	
	public DatoEquipo(String ip){
		this.id= String.valueOf(ULTIMO_ID++);	
		inicializarInfoCliente(ip);
	}
	
	private void inicializarInfoCliente(String ip) {
		if(ip == null){
			try {
				ip= Ip.getIpV4();
			} catch (UnknownHostException e) {
				e.printStackTrace();
				throw new RuntimeException("No se puede obtener el valor de la ip");
			}
		}
		cargarOtrosDatos();
	}

	private void cargarOtrosDatos() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public int compareTo(DatoEquipo o) {
		return this.id.compareTo(o.id);
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		DatoEquipo other = (DatoEquipo) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	@Override
	public String getID() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getMac() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getIp() {
		return ip;
	}

	@Override
	public String getbroadcast() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getMascara() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getRed() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getNombreEquipo() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getUsuario() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getSistemaOperativo() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getArquitecturaSO() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getVersionSO() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getJavaVersion() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getJavaNombreVM() {
		// TODO Auto-generated method stub
		return null;
	}

}
